package com.yan.test2;

/**
 * @author taoge
 * @Date 2024/8/4 16:02
 * @Description
 */
public class Work {
    private String name;
    private Integer age;
    private Integer wage;

    public Work() {

    }

    public Work(String name, Integer age, Integer wage) {
        this.name = name;
        this.age = age;
        this.wage = wage;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getWage() {
        return wage;
    }

    public void setWage(Integer wage) {
        this.wage = wage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Work work = (Work) o;

        if (name != null ? !name.equals(work.name) : work.name != null) return false;
        if (age != null ? !age.equals(work.age) : work.age != null) return false;
        return wage != null ? wage.equals(work.wage) : work.wage == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (age != null ? age.hashCode() : 0);
        result = 31 * result + (wage != null ? wage.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Work{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", wage=" + wage +
                '}';
    }

}
